package com.ty.xiaoyu.service.impl;

import com.ty.xiaoyu.entity.HomePageRotationChart;
import com.ty.xiaoyu.exception.HomePageRotationChartOperationException;
import com.ty.xiaoyu.service.HomePageRotationChartService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HomePageRotationChartServiceImpl extends BaseService implements HomePageRotationChartService {
    @Override
    public List<HomePageRotationChart> getHomePageRotationChartList() throws HomePageRotationChartOperationException {
        List<HomePageRotationChart> rotationChartList = homePageRotationChartMapper.queryRotationChart();
        if (rotationChartList == null || rotationChartList.isEmpty()) {
            throw new HomePageRotationChartOperationException("未找到轮播图");
        }
        return rotationChartList;
    }
}
